$(function () {
    $("a[rel=commentandtag]").bind("click", function () {
        $.guang.cmt.commentAndAddTags($(this), "", "", "", "", "", [], "fromNonDetail")
    });
    $("a[rel=changeGroup]").bind("click", function () {
        var b = "";
        $("#J_InterPer li a[rel=follow]").each(function () {
            b = 0 < b.length ? b + ("," + $(this).data("userid")) : b + $(this).data("userid")
        });
        var a = function (a) {
            var b = a.userPhoto, f = "http://static.guang.com/images/user/photo/avatar-50.png", c = [];
            if (0 < b.length && (c = b.split("|"), 1 <= c.length))for (b = 0; b < c.length; b++)-1 != c[b].indexOf("50x50") &&
            (f = c[b]);
            c = '<a class="username ofh" href="http://guang.com/u/' + a.userId + '" title="' + a.userNick + '">' + a.userNick + "</a>";
            a.level && "daren" == a.level && (c = '<a class="username g-daren" href="http://guang.com/u/' + a.userId + '" title="' + a.userNick + '"><em class="ofh">' + a.userNick + '</em><i class="i-daren">\u8fbe\u4eba</i></a>');
            return'<li><div class="user-pic"><a href="http://guang.com/u/' + a.userId + '" title="' + a.userNick + '" target="_blank"><img src="' + f + '" width="50" height="50" alt="' + a.userNick + '" title="' + a.userNick +
                '"></a></div><div class="user-info">' + c + "<p>" + a.description + '</p><a rel="follow" href="javascript:;" class="follow-btn" data-followtype="3" data-userid="' + a.tuser + '">\u52a0\u5173\u6ce8</a></div></li>'
        }, c = function (b) {
            var d = "";
            if (0 != b.length) {
                for (var f = 0; f < b.length; f++)d += a(b[f]);
                $("#J_InterPer").fadeOut("fast", function () {
                    $("#J_InterPer").html(d);
                    $("#J_InterPer").fadeIn()
                })
            } else $("#J_InterPer").html("<li><p>\u6728\u6709\u4e86\uff0c\u4f60\u597d\u5389\u5bb3\uff0c\u901b\u901b\u81ea\u6127\u4e0d\u5982\u3002</p></li>")
        };
        $.ajax({url:GUANGER.path + "/changeFriends", type:"post", dataType:"json", data:{ids:b}, success:function (a) {
            switch (a.code) {
                case 100:
                    $.isArray(a.snsFriendList) && 0 < a.snsFriendList.length ? c(a.snsFriendList) : c([]);
                    break;
                case 101:
                    alert(a.msg)
            }
        }})
    });
    $("a[rel=like]").live("click", function () {
        if ($.guang.dialog.isLogin()) {
            var b = $(this);
            if ("disable" != b.data("enable")) {
                b.data("enable", "disable");
                setTimeout(function () {
                    b.data("enable", "enable")
                }, 2E3);
                var a = b.attr("data-proid"), c = null, g = function (a) {
                    var f;
                    f = '<div id="cmtDialog" class="c-dialog" style="width:120px">';
                    $("body").append((0 == a ? f + '<p class="title clearfix">\u559c\u6b22\u4e86~</p>' : f + '<p class="title clearfix">&gt;_&lt;\u559c\u6b22\u8fc7\u4e86~</p>') + "</div>");
                    a = $.guang.util.getPosition(b).topMid();
                    f = $("#cmtDialog").outerWidth();
                    var g = $("#cmtDialog").outerHeight();
                    $("#cmtDialog").css({left:a.x - f / 2 + "px", top:a.y - g - 12 + "px"}).fadeIn();
                    c = setTimeout(function () {
                        $("#cmtDialog").fadeOut().remove()
                    }, 3E3)
                };
                $.guang.judgement.repeatIdentityClk = function () {
                    b.data("enable", "enable");
                    $("#cmtDialog")[0] && (clearTimeout(c),
                        $("#cmtDialog").remove());
                    g(3)
                };
                $.guang.judgement.identityCallback = function () {
                    b.data("enable", "enable");
                    $("#cmtDialog")[0] && (clearTimeout(c), $("#cmtDialog").remove());
                    g(0)
                };
                $.guang.judgement.identityOper(b, a, 0)
            }
        }
    });
    $("a[rel=forward]").live("click", function () {
        if ($.guang.dialog.isLogin()) {
            var b = $(this), a = b.data("feedsid"), c = "", g = b.parents(".byUser-feeds").find("h3").html(), d = "";
            $("#J_CmtForwardDialog").length && $("#J_CmtForwardDialog").remove();
            var f = '<label><input class="G_checkbox" type="checkbox" value="' +
                b.data("feedsid") + '"/> \u540c\u65f6\u8bc4\u8bba\u7ed9 ' + b.data("name1") + "</label>";
            "2" == b.attr("data-type") && (f = '<label><input class="G_checkbox" type="checkbox" value="' + b.data("feedsid") + '"/> \u540c\u65f6\u8bc4\u8bba\u7ed9 ' + b.data("name1") + "</label>", f += '<br/><label><input class="G_checkbox" type="checkbox" value="' + b.data("originid") + '"/> \u540c\u65f6\u8bc4\u8bba\u7ed9 ' + b.data("name2") + "</label>", g = b.parents(".byUser-feeds").find("h3").eq(1).html(), d = "//@" + b.data("name1") + b.parents(".byUser-feeds").find("h3 .content").text(),
                c = a, a = b.parents(".byUser-feeds").find("blockquote").data("feedsid"));
            $("body").append('<div id="J_CmtForwardDialog" class="g-dialog reply-dialog" style="width:430px;"><div class="dialog-content"><div class="hd"><h3>\u8f6c\u53d1</h3></div><div class="cmt bd clearfix" style="padding:10px;"><p style="background:#f7f7f7;padding-left:8px;line-height:30px;width:400px;" class="ofh">' + g + '</p><div class="cmt-reply" style="display:block"><textarea class="b-textarea J_ReplyTxt" style="margin-top:10px;height:66px;width:382px;">' +
                d + '</textarea><div class="reply-info clearfix"><div class="fl gc6" style="line-height:20px;">' + f + '</div><a class="sbl-btn" id="J_FeedsForwardSubmit">\u8f6c\u53d1</a></div></div></div><a class="close" href="javascript:;"></a></div></div>');
            var e = $("#J_CmtForwardDialog");
            e.overlay({top:"center", mask:{color:"#000", loadSpeed:200, opacity:0.3}, closeOnClick:!0, load:!0});
            var j = function (a, b) {
                if (/^\s*$/.test(b)) {
                    $.guang.tip.conf.tipClass = "tipmodal tipmodal-error";
                    $.guang.tip.show(a, "\u56de\u590d\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a~");
                    return false
                }
                if ($.guang.util.getStrLength(b) > 1E3) {
                    $.guang.tip.conf.tipClass = "tipmodal tipmodal-error";
                    $.guang.tip.show(a, "\u56de\u590d\u5185\u5bb9\u4e0d\u80fd\u8d85\u8fc71000~");
                    return false
                }
                return true
            }, h = null, i = function (a) {
                if ($("#cmtDialog")[0]) {
                    clearTimeout(h);
                    $("#cmtDialog").remove()
                }
                var f;
                f = '<div id="cmtDialog" class="c-dialog" style="width:120px">';
                $("body").append((a == 0 ? f + '<p class="title clearfix">\u8f6c\u53d1\u6210\u529f~</p>' : f + '<p class="title clearfix">&gt;_&lt;\u8f6c\u53d1\u5931\u8d25~</p>') +
                    "</div>");
                a = $.guang.util.getPosition(b).topMid();
                f = $("#cmtDialog").outerWidth();
                var c = $("#cmtDialog").outerHeight();
                $("#cmtDialog").css({left:a.x - f / 2 + "px", top:a.y - c - 12 + "px"}).fadeIn();
                h = setTimeout(function () {
                    $("#cmtDialog").fadeOut().remove()
                }, 3E3)
            };
            $("#J_FeedsForwardSubmit").unbind().bind("click", function () {
                var b = $(this), f = e.find("textarea").val();
                if (!j(b, f))return false;
                var d = [];
                e.find("input:checked").each(function () {
                    d.push(this.value)
                });
                d = d.join(",");
                $.ajax({url:GUANGER.path + "/feedsForward", type:"post",
                    dataType:"json", data:{feedsId:a, forwardId:c, content:f, commentFeedsIds:d}, success:function (a) {
                        if (a.code == 100) {
                            $.guang.tip.conf.tipClass = "tipmodal tipmodal-general-short";
                            i(0)
                        } else {
                            $.guang.tip.conf.tipClass = "tipmodal tipmodal-error3";
                            i(1)
                        }
                        e.overlay().close()
                    }})
            })
        }
    });
    $("a[rel=likebrand]").click(function () {
        var b = $(this);
        if ("disable" != b.data("enable") && (b.data("enable", "disable"), setTimeout(function () {
            b.data("enable", "enable")
        }, 2E3), $.guang.dialog.isLogin())) {
            var a = null, c = function (c) {
                var d;
                d = '<div id="cmtDialog" class="c-dialog" style="width:120px">';
                $("body").append((0 == c ? d + '<p class="title clearfix">\u559c\u6b22\u4e86~</p>' : d + '<p class="title clearfix">&gt;_&lt;\u559c\u6b22\u8fc7\u4e86~</p>') + "</div>");
                c = $.guang.util.getPosition(b).topMid();
                d = $("#cmtDialog").outerWidth();
                var f = $("#cmtDialog").outerHeight();
                $("#cmtDialog").css({left:c.x - d / 2 + "px", top:c.y - f - 12 + "px"}).fadeIn();
                a = setTimeout(function () {
                    $("#cmtDialog").fadeOut().remove()
                }, 3E3)
            };
            $.guang.judgement.repeattaolunzuLikeClk = function () {
                b.data("enable", "enable");
                $("#cmtDialog")[0] && (clearTimeout(a),
                    $("#cmtDialog").remove());
                c(3)
            };
            $.guang.judgement.taolunzuLikeCallback = function () {
                b.data("enable", "enable");
                $("#cmtDialog")[0] && (clearTimeout(a), $("#cmtDialog").remove());
                c(0)
            };
            $.guang.judgement.taolunzuLikeSubmit($(this), {url:GUANGER.path + "/pinpai/" + b.data("url") + "/_favor"})
        }
    });
    $("a[rel=liketopic]").click(function () {
        var b = $(this);
        if ("disable" != b.data("enable") && (b.data("enable", "disable"), setTimeout(function () {
            b.data("enable", "enable")
        }, 2E3), $.guang.dialog.isLogin())) {
            var a = null, c = function (c) {
                var d;
                d = '<div id="cmtDialog" class="c-dialog" style="width:120px">';
                $("body").append((0 == c ? d + '<p class="title clearfix">\u559c\u6b22\u4e86~</p>' : d + '<p class="title clearfix">&gt;_&lt;\u559c\u6b22\u8fc7\u4e86~</p>') + "</div>");
                c = $.guang.util.getPosition(b).topMid();
                d = $("#cmtDialog").outerWidth();
                var f = $("#cmtDialog").outerHeight();
                $("#cmtDialog").css({left:c.x - d / 2 + "px", top:c.y - f - 12 + "px"}).fadeIn();
                a = setTimeout(function () {
                    $("#cmtDialog").fadeOut().remove()
                }, 3E3)
            };
            $.guang.judgement.repeattaolunzuLikeClk = function () {
                b.data("enable",
                    "enable");
                $("#cmtDialog")[0] && (clearTimeout(a), $("#cmtDialog").remove());
                c(3)
            };
            $.guang.judgement.taolunzuLikeCallback = function () {
                b.data("enable", "enable");
                $("#cmtDialog")[0] && (clearTimeout(a), $("#cmtDialog").remove());
                c(0)
            };
            $.guang.judgement.taolunzuLikeSubmit($this, {url:GUANGER.path + "/favorTopic", data:{name:b.data("url")}})
        }
    });
    $("a[rel=likescene]").click(function () {
        var b = $(this);
        if ("disable" != b.data("enable") && (b.data("enable", "disable"), setTimeout(function () {
            b.data("enable", "enable")
        }, 2E3), $.guang.dialog.isLogin())) {
            var a =
                null, c = function (c) {
                var d;
                d = '<div id="cmtDialog" class="c-dialog" style="width:120px">';
                $("body").append((0 == c ? d + '<p class="title clearfix">\u559c\u6b22\u4e86~</p>' : d + '<p class="title clearfix">&gt;_&lt;\u559c\u6b22\u8fc7\u4e86~</p>') + "</div>");
                c = $.guang.util.getPosition(b).topMid();
                d = $("#cmtDialog").outerWidth();
                var f = $("#cmtDialog").outerHeight();
                $("#cmtDialog").css({left:c.x - d / 2 + "px", top:c.y - f - 12 + "px"}).fadeIn();
                a = setTimeout(function () {
                    $("#cmtDialog").fadeOut().remove()
                }, 3E3)
            };
            $.guang.judgement.repeattaolunzuLikeClk =
                function () {
                    b.data("enable", "enable");
                    $("#cmtDialog")[0] && (clearTimeout(a), $("#cmtDialog").remove());
                    c(3)
                };
            $.guang.judgement.taolunzuLikeCallback = function () {
                b.data("enable", "enable");
                $("#cmtDialog")[0] && (clearTimeout(a), $("#cmtDialog").remove());
                c(0)
            };
            $.guang.judgement.taolunzuLikeSubmit($this, {url:"/xihuan/scene/" + b.data("url") + "/favor"})
        }
    });
    $(".main li").bind("mouseover mouseout", function (b) {
        var a = $(this);
        "mouseover" == b.type ? (0 < a.parents(".baobei").length && a.css({border:"1px solid #ddd"}), a.hasClass("topic-item") &&
            a.addClass("hover"), a.find(".ilike-m")[0] ? a.find(".ilike-m").show() : a.find(".ilike-del")[0] && a.find(".ilike-del").show(), a.find(".ilike-topic")[0] && a.find(".ilike-topic").show()) : (0 < a.parents(".baobei").length && a.css({border:"1px solid #f1f1f1"}), a.hasClass("topic-item") && a.removeClass("hover"), a.find(".ilike-m")[0] ? a.find(".ilike-m").hide() : a.find(".ilike-del")[0] && a.find(".ilike-del").hide(), a.find(".ilike-topic")[0] && a.find(".ilike-topic").hide())
    });
    $(".ilike-del").live("click", function () {
        if ($.guang.dialog.isLogin()) {
            var b =
                $(this).data("proid"), a = $(this).data("type"), c = $(this).parent().hasClass("goods-pic") ? $(this).closest(".goods") : $(this).closest("li"), e = "", d = {};
            switch (a) {
                case 4:
                    e = GUANGER.path + "/unfavor.html";
                    d = {productId:b};
                    break;
                case 5:
                    e = GUANGER.path + "/u/topic/delete";
                    d = {topicId:b};
                    break;
                case 6:
                    e = GUANGER.path + "/u/scene/delete";
                    d = {scenarioId:b};
                    break;
                case 7:
                    e = GUANGER.path + "/pinpai/" + b + "/cancleFavor";
                    break;
                case 8:
                    e = GUANGER.path + "/removeShare", d = {productId:b}
            }
            $.ajax({url:e, type:"post", dataType:"json", data:d, success:function (a) {
                switch (a.code) {
                    case 100:
                        c.addClass("goods-gray");
                        break;
                    case 101:
                        alert(a.msg)
                }
            }})
        }
    });
    $("a[rel=sharepro]").shareBtn();
    var e = function (b, a, c) {
        $("#J_ConfirmD")[0] && $("#J_ConfirmD").remove();
        $("body").append('<div id="J_ConfirmD" class="g-dialog tip-dialog"><div class="dialog-content"><div class="hd"><h3>\u63d0\u793a</h3></div><div class="bd clearfix">' + ('<p class="pt10 tac">' + b + "</p>") + '<div class="act-row"><p class="inlineblock"><a class="bbl-btn mr10" id="J_Confirm" href="javascript:;">\u786e\u5b9a</a><a class="bgr-btn" id="J_Cancel" href="javascript:;">\u53d6\u6d88</a></p></div></div><a class="close" href="javascript:;"></a></div></div>');
        $("#J_ConfirmD").overlay({top:"center", mask:{color:"#000", loadSpeed:200, opacity:0.3}, closeOnClick:!0, load:!0, onClose:function () {
            c();
            $("#commentDialog,#exposeMask").remove()
        }});
        $("#J_Cancel").unbind("click").click(function () {
            $("#J_ConfirmD").overlay().close()
        });
        $("#J_Confirm").unbind("click").click(function () {
            $("#J_ConfirmD").overlay().close();
            a()
        })
    };
    $.guang.addFollowCallback = function () {
    };
    $("a[rel=follow]").live("click", function () {
        $.guang.dialog.isLogin() && "false" != $(this).data("enable") && ($(this).data("enable",
            "false"), $this = $(this), $.ajax({url:GUANGER.path + "/addFollow", type:"post", dataType:"json", data:{tuserId:$(this).data("userid")}, jQueryDom:$this, success:function (b) {
            switch (b.code) {
                case 100:
                    this.jQueryDom.data("enable", "true");
                    $.guang.addFollowCallback(b, this.jQueryDom);
                    break;
                case 101:
                    $this.data("enable", "true");
                    $.guang.tip.conf.tipClass = "tipmodal tipmodal-error2";
                    $.guang.tip.show($this, "\u53c2\u6570\u9519\u8bef");
                    break;
                case 103:
                    $this.data("enable", "true");
                    $.guang.tip.conf.tipClass = "tipmodal tipmodal-error2";
                    $.guang.tip.show($this, "\u91cd\u590d\u5173\u6ce8\u4e86\u4f60\u7684\u670b\u53cb\uff01");
                    break;
                case 111:
                    $this.data("enable", "true");
                    $.guang.tip.conf.tipClass = "tipmodal tipmodal-error2";
                    $.guang.tip.show($this, "\u62b1\u6b49\uff0c\u4f60\u7684\u5173\u6ce8\u5df2\u8fbe\u4e0a\u9650\u3002");
                    break;
                case 300:
                    $.guang.dialog.login();
                    break;
                case 446:
                    $.guang.tip.conf.tipClass = "tipmodal tipmodal-error2", $.guang.tip.show($this, "\u4f60\u5df2\u88ab\u7981\u6b62\u5173\u6ce8\u597d\u53cb\uff01")
            }
        }}))
    });
    $.guang.removeFansCallback =
        function (b) {
            b.parents(".section").remove()
        };
    $("a[rel=removefans]").live("click", function () {
        if ($.guang.dialog.isLogin() && "false" != $(this).data("enable")) {
            $(this).data("enable", "false");
            $this = $(this);
            var b = "\u786e\u5b9a\u8981\u79fb\u9664\u7c89\u4e1d\u201c" + $this.data("usernick") + "\u201d\uff1f";
            e(b, function () {
                $.ajax({url:GUANGER.path + "/removeFans", type:"post", dataType:"json", data:{tuserId:$this.data("userid")}, success:function (a) {
                    switch (a.code) {
                        case 100:
                            $this.data("enable", "true");
                            $.guang.removeFansCallback($this,
                                a);
                            break;
                        case 101:
                            $this.data("enable", "true");
                            $.guang.tip.conf.tipClass = "tipmodal tipmodal-error2";
                            $.guang.tip.show($this, a.msg);
                            break;
                        case 300:
                            $.guang.dialog.login()
                    }
                }})
            }, function () {
                $this.data("enable", "true")
            })
        }
    });
    $.guang.removeFollowCallback = function () {
        o.parents(".section").remove()
    };
    $("a[rel=removefollow]").live("click", function () {
        if ($.guang.dialog.isLogin() && "false" != $(this).data("enable")) {
            $(this).data("enable", "false");
            var b = $(this), a = "\u786e\u5b9a\u4e0d\u518d\u5173\u6ce8\u201c" + b.data("usernick") +
                "\u201d\uff1f";
            e(a, function () {
                $.ajax({url:GUANGER.path + "/removeFollow", type:"post", dataType:"json", data:{tuserId:b.data("userid")}, success:function (a) {
                    switch (a.code) {
                        case 100:
                            b.data("enable", "true");
                            $.guang.removeFollowCallback(a, b);
                            break;
                        case 101:
                            b.data("enable", "true");
                            $.guang.tip.conf.tipClass = "tipmodal tipmodal-error2";
                            $.guang.tip.show(b, "\u53c2\u6570\u9519\u8bef");
                            break;
                        case 300:
                            $.guang.dialog.login()
                    }
                }})
            }, function () {
                b.data("enable", "true")
            })
        }
    });
    $.guang.addFollowCallback = function (b, a) {
        "0" == a.attr("data-followtype") &&
        (b.isYouFollowed ? a.after("<div class='followed-btn-big'>\u4e92\u76f8\u5173\u6ce8<span class='mr5 ml5'>|</span><a rel='removefollow' data-followtype='0' data-usernick=" + a.data("usernick") + " data-userid='" + a.data("userid") + "' href='javascript:;'>\u53d6\u6d88</a></div>") : a.after("<div class='followed-btn-big'>\u5df2\u5173\u6ce8<span class='mr5 ml5'>|</span><a rel='removefollow' data-followtype='0' data-usernick=" + a.data("usernick") + " data-userid='" + a.data("userid") + "' href='javascript:;'>\u53d6\u6d88</a></div>"),
            a.remove());
        "1" == a.attr("data-followtype") && (a.after("<div class='followed-btn'>\u4e92\u76f8\u5173\u6ce8<span class='mr5 ml5'>|</span><a rel='removefollow' data-followtype='1' data-usernick=" + a.data("usernick") + " data-userid='" + a.data("userid") + "' href='javascript:;'>\u53d6\u6d88</a></div>"), a.remove());
        "4" == a.attr("data-followtype") && (b.isYouFollowed ? a.after("<div class='followed-btn'>\u4e92\u76f8\u5173\u6ce8</div>") : a.after("<div class='followed-btn'>\u5df2\u5173\u6ce8</div>"), a.remove());
        "5" ==
            a.attr("data-followtype") && (b.isYouFollowed ? a.after("<div class='followed-btn'>\u4e92\u76f8\u5173\u6ce8<span class='mr5 ml5'>|</span><a rel='removefollow' data-followtype='5' data-usernick=" + a.data("usernick") + " data-userid='" + a.data("userid") + "' href='javascript:;'>\u53d6\u6d88</a></div>") : a.after("<div class='followed-btn'>\u5df2\u5173\u6ce8<span class='mr5 ml5'>|</span><a rel='removefollow' data-followtype='5' data-usernick=" + a.data("usernick") + " data-userid='" + a.data("userid") + "' href='javascript:;'>\u53d6\u6d88</a></div>"),
            a.remove());
        if ("3" == a.attr("data-followtype")) {
            for (var c = a.parents("li").siblings(), e = "", d = 0; d < c.length; d++)e += e.length ? "," + c.eq(d).find("a[rel=follow]").attr("data-userid") : c.eq(d).find("a[rel=follow]").attr("data-userid");
            $.ajax({url:GUANGER.path + "/u/getUserInterested.html", type:"post", dataType:"json", data:{tuserIds:e}, success:function (b) {
                switch (b.code) {
                    case 100:
                        if (b.snsFriend) {
                            b = b.snsFriend;
                            if (!b.userPhoto || b.userPhoto.length == 0)b.userPhoto = "http://static.guang.com/images/user/photo/avatar-50.png";
                            b = '<li><div class="user-pic"><a href="' + GUANGER.path + "/u/" + b.userId + '" title="' + b.userNick + '"><img src="' + b.userPhoto + '" width="50" height="50" alt="' + b.userNick + '" title="' + b.userNick + '"/></a></div><div class="user-info"><p class="username"><a href="' + GUANGER.path + "/u/" + b.userId + '" title="' + b.userNick + '">' + b.userNick + "</a></p><p>" + b.description + '</p><a rel="follow" href="javascript:;" class="follow-btn" data-followtype="3" data-userid="' + b.tuser + '">\u52a0\u5173\u6ce8</a></div></li>';
                            a.parents("li").after(b)
                        }
                        a.parents("li").remove();
                        break;
                    case 101:
                        a.parents("li").remove()
                }
            }})
        }
    };
    $.guang.removeFollowCallback = function (b, a) {
        "0" == a.attr("data-followtype") && (a.parent().after("<a rel='follow' href='javascript:;' class='follow-btn-big' data-followtype='0' data-usernick=" + a.data("usernick") + " data-userid=" + a.data("userid") + ">\u52a0\u5173\u6ce8</a>"), a.parent().remove());
        "1" == a.attr("data-followtype") && (a.parent().after("<a rel='follow' href='javascript:;' class='follow-btn' data-followtype='1' data-usernick=" + a.data("usernick") + " data-userid=" +
            a.data("userid") + ">\u52a0\u5173\u6ce8</a>"), a.parent().remove());
        "5" == a.attr("data-followtype") && (a.parent().after("<a rel='follow' href='javascript:;' class='follow-btn' data-followtype='5' data-usernick=" + a.data("usernick") + " data-userid=" + a.data("userid") + ">\u52a0\u5173\u6ce8</a>"), a.parent().remove());
        "2" == a.attr("data-followtype") && a.parents(".section").remove()
    }
});
$(function () {
    $(".side .feeds .news-item").hover(function () {
        var e = $(this);
        e.parents(".news-list").css("z-index", "10");
        this.timeoutId && (clearTimeout(this.timeoutId), this.timeoutId = null);
        e.addClass("on")
    }, function () {
        var e = $(this);
        this.timeoutId = setTimeout(function () {
            e.removeClass("on");
            e.parents(".news-list").css("z-index", "0")
        }, 200)
    });
    $(".viewlike").hover(function () {
        $(this).find(".ilike").show()
    }, function () {
        $(this).find(".ilike").hide()
    });
    $(".J_ReplyTo").live("mouseover", function () {
        var e = $(this);
        "" ==
            e.data("userid") && (e.removeAttr("href"), $.guang.tip.conf.tipClass = "tipmodal tipmodal-error", $.guang.tip.show(e, "\u62b1\u6b49\uff0c\u8be5\u6635\u79f0\u76ee\u524d\u4e0d\u5b58\u5728\u54e6\u3002"))
    });
    $(".side .news")[0] && $(".news-box").textSlider({speed:"slow", step:1, timer:3E3})
});
$(function () {
    var e = 0, b = $(".side #J_FeedsNews"), a = $(".side #J_FeedsNews li"), c = function (a, f, e) {
        f > a ? (b.scrollTop(a + 1), setTimeout(function () {
            c(a + 1, f, e)
        }, 20)) : e && e()
    }, g = function () {
        var d = b.scrollTop(), f = d + 47;
        e++;
        e >= a.length ? c(d, f, function () {
            b.scrollTop(0);
            e = 0
        }) : c(d, f);
        setTimeout(g, 5E3)
    };
    3 < a.length && (b.append(a.slice(0, 3).clone()), setTimeout(g, 5E3))
});
$(function () {
    var e = function () {
        $.ajax({url:GUANGER.path + "/feeds_count", type:"post", dataType:"json", success:function (a) {
            100 == a.code && 0 !== a.feedsMessageNum && ($("#J_FeedsNotes").length ? $("#J_FeedsNotes").html("\u6709 " + a.feedsMessageNum + " \u6761\u65b0\u52a8\u6001\uff0c\u70b9\u51fb\u5237\u65b0") : $(".feeds-menu").after("<a id='J_FeedsNotes' href='javascript:;'>\u6709 " + a.feedsMessageNum + " \u6761\u65b0\u52a8\u6001\uff0c\u70b9\u51fb\u5237\u65b0</a>"), $("#J_FeedsNotes").bind("click", function () {
                var a = window.location.href;
                -1 == a.indexOf("?") ? window.location.reload() : window.location.href = a.split("?")[0]
            }))
        }});
        setTimeout(e, 3E4)
    };
    "" != GUANGER.userId && setTimeout(e, 3E4);
    var b = window.location.href;
    -1 != b.indexOf("ex=1") && 0 != $("#J_OnlyComment").length && ($("#J_OnlyComment")[0].checked = !0);
    $("#J_OnlyComment").click(function () {
        window.location.href = this.checked && b.indexOf("ex=1") == -1 ? b + (b.indexOf("?") != -1 ? "&ex=1" : "?ex=1") : b.replace(/[?&]ex=1/, "")
    })
});
